<style lang="scss">
  @import 'index';
</style>

<template>
  <div class="ga-container">
    <div class="ga-product-hot">
      <ul class="ga-group-list ga-media-list">
        <li v-for="(item,index) in proList" :key="index">
          <a class="item" :href="'../shopDetail/main?id='+item.id">
            <!--top1-->
            <div class="top" :class="{'top1':index===0, 'top2': index===1, 'top3': index===2 }"></div>

            <div class="item-media">
              <image class="img-box" mode="aspectFill" :src="item.icon"></image>
            </div>
            <div class="item-inner">
              <p class="title">{{item.goods_name}} </p>
              <p class="p1"></p>
              <p class="p2">已售<span>{{item.sale_num}}</span>件</p>
              <p class="p3">
                市场价<span>{{item.market_price}}</span>
              </p>
              <p class="p4">
                现价
                ¥<span> {{item.shop_price}}</span>
              </p>
              <div class="btn primary">去购买 <i class="icon-angle-right"></i></div>
            </div>
          </a>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      proList: []

    }
  },
  methods: {
    async load () {
      this.$_util.ajax.post('https://guo-a.com/mapi/product/productlist',{
        sort: 'sales',
        sorttype: 'desc'
      }).then((res) => {
          if(res.code === 200){
            this.proList = res.data
          }
      })
    }

  },

  created () {

  },
  mounted () {
    this.load()
  }
}
</script>
